package com.wyl.clinic.common;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 创建并注册一个拦截器
        registry.addInterceptor(new AuthInterceptor())
                .excludePathPatterns(
                        "/login", // 登录接口路径
                        "/register" // 注册接口路径
                );
    }
}
